#include <iostream>
#include <vector>


struct Node {
    int key;
    Node* next = nullptr;
    explicit Node(int key, Node* next=nullptr) : key(key), next(next) {}
};

int size(Node* head);
void print(Node* head);
void print(std::vector<int> vec);
Node* create_list(std::vector<int> nums);
void insert(Node*& head, int new_key);
void remove(Node*& head, int old_key);
void insert_after(Node* head, int old_key, int new_key);
void delete_first_element(Node*& head);
void delete_last_element(Node*& head);
void delete_list(Node*& head);
Node* interleave(Node* list1, Node* list2);
std::vector<int> to_vector(Node* head);
